<?php
namespace app;

class Result
{
    //success
    static public function Success($data = [], $msg = 'success')
    {
        $rs = [
            'code' => 1,
            'msg' => $msg,
            'data' => $data,
        ];
        return json($rs);
    }
    static public function Error($msg)
    {
        $rs = [
            'code' => 0,
            'msg' => $msg,
            'data' => array(),
        ];
        return json($rs);
    }
    //error
    static public function Code_Error($code, $msg)
    {
        $rs = [
            'code' => $code,
            'msg' => $msg,
            'data' => array(),
        ];
        return json($rs);
    }
}